﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MainMaster.master" AutoEventWireup="true"
    CodeFile="registerstep2.aspx.cs" Inherits="registerstep2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CssLinkHolder" runat="Server">
    <link href="themes/css/formValidator.css" type="text/css" rel="Stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="Server">
    <div class="reg_step">
        <ul>
            <li class="cur1"><span>1</span> Complete Account Information</li>
            <li class="current"><span>2</span> Complete Company Information</li>
            <li class="last"><span>3</span> Success</li>
        </ul>
    </div>
    <div class="reg_left" style="width: 978px;">
        <fieldset class="regBox first">
            <legend>Company Profile</legend>
            <div class="basicinfo">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="198" height="30" align="right" valign="top">
                            <div class="busloc">
                                <span class="text_red">* </span><strong>Business Location:&nbsp;</strong>&nbsp;</div>
                        </td>
                        <td>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="20%" height="30">
                                        Country/Region:
                                    </td>
                                    <td width="80%">
                                        <asp:Literal ID="ltCountry" runat="server"></asp:Literal>
                                    </td>
                                </tr>
                                <tr style="<%if(!rptProvince.Visible){%>display:none; <%}%>">
                                    <td height="30">
                                        Province/State:
                                    </td>
                                    <td>
                                        <select id="dropdownProvince" name="dropdownProvince">
                                            <option value="-1" selected="selected">Please Select</option>
                                            <asp:Repeater ID="rptProvince" runat="server">
                                                <ItemTemplate>
                                                    <option value="<%#Eval("Value") %>" <%#Eval("Seleced") %>>
                                                        <%#Eval("Text") %></option>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </select>
                                        <div id="dropdownProvinceTip">
                                        </div>
                                    </td>
                                </tr>
                                <tr style="<%if(!rptProvince.Visible){%>display: none;<%}%>">
                                    <td height="30">
                                        City/Town:
                                    </td>
                                    <td>
                                        <select id="dropdownCity" name="dropdownCity">
                                            <option value="-1" selected="selected">Please Select</option>
                                        </select>
                                        <div id="dropdownCityTip">
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="30">
                                        Street:
                                    </td>
                                    <td>
                                        <input name="txtAddress" type="text" class="userinput" id="txtAddress" style="width: 154px;">
                                    </td>
                                </tr>
                                <tr>
                                    <td height="30">
                                        Zip/Postal Code:
                                    </td>
                                    <td>
                                        <input name="txtPostCode" type="text" class="userinput" id="txtPostCode" style="width: 154px;">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td width="198" height="30" align="right">
                            <span class="text_red">* </span><strong>Business Type:&nbsp;</strong>&nbsp;
                        </td>
                        <td>
                            <select name="dropdownBussiness" id="dropBussiness" style="width: 320px;">
                                <option value="-1" selected="selected">Please Select</option>
                                <asp:Repeater ID="rptBussinessType" runat="server">
                                    <ItemTemplate>
                                        <option value="<%#Eval("Idx") %>">
                                            <%#Eval("Value")%></option>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </select>
                            <div id="dropBussinessTip">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td width="198" height="30" align="right">
                            <span class="text_red">* </span><strong>Main Product:&nbsp;</strong>&nbsp;
                        </td>
                        <td>
                            <input type="text" name="txtMainProduct" id="txtMainProduct" class="userinput">
                            <div id="txtMainProductTip">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td width="198" height="30" align="right">
                            <strong>OE Experience:&nbsp;</strong>&nbsp;
                        </td>
                        <td>
                            <label>
                                <input name="rbtnIsOE" type="radio" id="rbtnIsOE_1" value="1" checked>Yes</label>&nbsp;&nbsp;&nbsp;<label><input
                                    name="rbtnIsOE" type="radio" value="0" id="rbtnIsOE_2">No</label>
                        </td>
                    </tr>
                    <tr>
                        <td width="198" height="30" align="right">
                            <strong>Export Experience:</strong>&nbsp;&nbsp;
                        </td>
                        <td>
                            <label>
                                <input name="rbtnIsExport" type="radio" id="rbtnIsExport_1" value="1" checked>Yes</label>&nbsp;&nbsp;&nbsp;<label><input
                                    name="rbtnIsExport" type="radio" value="0" id="rbtnIsExport_2">No</label>
                        </td>
                    </tr>
                    <tr>
                        <td width="198" height="30" align="right">
                            <strong>WebSite:</strong>&nbsp;&nbsp;
                        </td>
                        <td>
                            <label>
                                <input name="txtWebSite" type="text" class="userinput" id="txtWebSite" value="http://">
                            </label>
                        </td>
                    </tr>
                    <tr>
                        <td height="54" align="right">
                            <strong>Exprot Market:</strong>&nbsp;&nbsp;
                        </td>
                        <td>
                            <asp:DataList ID="rptChkMarket" ItemStyle-Width="120" RepeatColumns="6" RepeatDirection="Horizontal"
                                runat="server">
                                <ItemTemplate>
                                    <input name="chkMarket" <%#Eval("Checked") %> type="checkbox" value="<%#Eval("Value") %>"
                                        class="radio">
                                    <%#Eval("Text") %>
                                </ItemTemplate>
                            </asp:DataList>
                        </td>
                    </tr>
                    <tr>
                        <td width="198" height="192" align="right" valign="top">
                            <div class="busloc">
                                <span class="text_red">* </span><strong>Company Description:&nbsp;</strong>&nbsp;</div>
                        </td>
                        <td>
                            <textarea name="txtDescription" id="txtDescription" cols="" rows="" class="usertextarea"
                                style="width: 500px; height: 150px;"></textarea><div class="reg_not">
                                    Please don't write your e-mail address and HTML Tag. Between 100 to 5000 characters.</div>
                            <div id="txtDescriptionTip" style="left:550px;">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </fieldset>
        <div class="reg_save">
            <input name="Submit" type="submit" value="Continue" id="btnSubmit" class="userleftsub regsub" /></div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JsHolder" runat="Server">
    <script type="text/javascript" src="themes/scripts/formValidator-4.0.1.min.js"></script>
    <script type="text/javascript">

        (function ($) {
            $.ajaxDataControl = {

                clearAllData: function (control) {
                    control.each(function () {

                        while (this.options.length > 1) {
                            this.options.remove(1);
                        }
                        this.selecedIndex = 0;
                    })
                },
                successCallback: function (context, data) {
                    var subControl = jQuery(context.setting.sub + ":first").get(0);
                    if (subControl != null && data.length > 0) {
                        for (var i = 0; i < data.length; i++) {
                            subControl.options.add(new Option(data[i].Text, data[i].Value));
                        }
                    }
                },
                sendAjax: function (url, data, control) {

                    var temp_data = { "st": Math.random() * 10000 };
                    temp_data[control.id] = jQuery(control).val();
                    $.extend(true, temp_data, data);
                    jQuery.ajax({
                        url: url,
                        data: temp_data,
                        dataType: "JSON",
                        success: function (e) { $.ajaxDataControl.successCallback(control, e); },
                        error: function (response) { window.alert(response.responseText); }
                    });
                }
            };


            $.fn.ajaxDataControl = function (options) {

                return this.each(function () {
                    var setting_temp = { sub: "", parent: "", data: {} };
                    $.extend(true, setting_temp, options);
                    this.setting = setting_temp;
                    jQuery(this).bind("change", function () {
                        $.ajaxDataControl.clearAllData(jQuery(setting_temp.sub));

                        $.ajaxDataControl.sendAjax(setting_temp.url, setting_temp.data, this);
                    })
                });
            };

        })(jQuery);





        jQuery(function () {
            jQuery.formValidator.initConfig({ submitButtonID: "btnSubmit", autoTip: false, debug: false, onSuccess: function () { return true; }, onError: function () { } });

            jQuery("#dropBussiness").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "" }, onError: "Bussiness type is  required" });
            jQuery("#txtDescription").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "" }, onError: "Company description is  required" });
            jQuery("#txtMainProduct").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "" }, onError: "Main product is  required" });

        });


    </script>
    <%if (rptProvince.Visible) { %>
    <script type="text/javascript">
        jQuery(function () {
            jQuery("#dropdownProvince").ajaxDataControl({ url: "AjaxGet.ashx?cmd=2020", sub: "#dropdownCity" });
            jQuery("#dropdownProvince").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "" }, onError: "Province is required" });
            jQuery("#dropdownCity").formValidator({ onShow: " ", onFocus: " ", onCorrect: " " }).inputValidator({ min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "" }, onError: "City is  required" });
        });
    </script>
    <%} %>
</asp:Content>
